package thinkinjava1.ch12;

/**
 * Alias1 别名问题
 * <p>
 * author: 顾博君 <br>
 * time:   2017/2/24 14:30 <br>
 * e-mail: gubojun@csii.com.cn <br>
 * </p>
 */
public class Alias1 {
    int i;

    Alias1(int ii) {
        i = ii;
    }

    public static void main(String[] args) {
        Alias1 x = new Alias1(7);
        Alias1 y = x; // Assign the handle
        System.out.println("x: " + x.i);
        System.out.println("y: " + y.i);
        System.out.println("Incrementing x");
        x.i++;
        System.out.println("x: " + x.i);
        System.out.println("y: " + y.i);
    }
}
